;Assembler header file for Portable
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:03:54 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 9 Jun 1995

        [       :LNOT: :DEF: Portable_Hdr
        GBLS    Portable_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for constants
Portable_PortEconet             *       &1
Portable_PortSerial             *       &8
Portable_PortFDC                *       &4000
Portable_ControlEconetPowerEnabled *       &1
Portable_ControlLCDPowerEnabled *       &2
Portable_ControlExternalVideoEnabled *       &4
Portable_ControlSerialEnabled   *       &8
Portable_ControlDualPanelEnabled *       &10
Portable_ControlVideoClock      *       &30
Portable_ControlVideoClockShift *       5
Portable_ControlVideoClockExternal *       0
Portable_ControlVideoClockDividedCrystal *       1
Portable_ControlVideoClockCrystal *       2
Portable_ControlInvertVideoClock *       &80
Portable_ControlBackLightEnabled *       &100
Portable_ControlExtraDisplayLines *       &200
Portable_ControlExtraDualPanelDRAM *       &400
Portable_ControlSoundPowerEnabled *       &800
Portable_ControlPCMCIAEnabled   *       &1000
Portable_ControlParallelEnabled *       &2000
Portable_ControlFDCEnabled      *       &4000
Portable_ControlIDEEnabled      *       &8000
Portable_ControlLCDVideoInverted *       &10000
Portable_ControlTrackerballEnabled *       &20000
Portable_ControlMouseEnabled    *       &40000
Portable_BMUVariableVersion     *       &0
Portable_BMUVariableNominalCharge *       &1
Portable_BMUVariableMeasuredCharge *       &2
Portable_BMUVariableUsedCharge  *       &3
Portable_BMUVariableUsableCharge *       &4
Portable_BMUVariableChargeEstimate *       &6
Portable_BMUVariableInstVoltage *       &7
Portable_BMUVariableInstCurrent *       &8
Portable_BMUVariableInstTemperature *       &9
Portable_BMUVariableFlags       *       &A
Portable_BMUVariableChargeRate  *       &B
Portable_BMUAtThreshold3        *       &1
Portable_BMUBatteryChanged      *       &1
Portable_BMULidOpen             *       &2
Portable_BMUAtThreshold2        *       &4
Portable_BMUBatteryFlat         *       &4
Portable_BMUAtThreshold1        *       &8
Portable_BMUBatteryLow          *       &8
Portable_BMUChargingFault       *       &10
Portable_BMUChargeStateKnown    *       &20
Portable_BMUBatteryPresent      *       &40
Portable_BMUChargerConnected    *       &80
Portable_SpeedFast              *       &0
Portable_SpeedSlow              *       &1
Portable_BMUPowerOff            *       &0
Portable_BMUSetAutostart        *       &4
Portable_BMUDisconnectCharger   *       &5
Portable_BMUConnectCharger      *       &6
Portable_SupportsSpeed          *       &1
Portable_SupportsIdle           *       &10
Portable_SupportsStop           *       &20
Portable_RestartKeyboard        *       &1
Portable_RestartClock           *       &2
Portable_StatusDockStationPresent *       &1
Portable_StatusFloppyConnected  *       &2
Portable_StatusTrackerballConnected *       &4
Portable_StatusLCDInUse         *       &8
Portable_PowerDown              *       &0
Portable_PowerUp                *       &1
Portable_PowerStop              *       &2
Portable_PowerStart             *       &3

;Symbols for structure offsets and sizes
                                ^       0
                                #       Bits
Portable_ProcessorSpeed         *       @

                                ^       0
                                #       Bits
Portable_ControlFlags           *       @

                                ^       0
                                #       Int
Portable_BMUVariable            *       @

                                ^       0
                                #       Bits
Portable_BMUFlags               *       @

                                ^       0
                                #       Int
Portable_BMUCommand             *       @

                                ^       0
                                #       Bits
Portable_Features               *       @

                                ^       0
                                #       Int
Portable_RestartType            *       @

                                ^       0
                                #       Bits
Portable_StatusFlags            *       @

                                ^       0
                                #       Int
Portable_State                  *       @


;Symbols for SWI's and SWI reason codes
XPortable_Speed                 *       &62FC0
Portable_Speed                  *       &42FC0
   ;Entry
   ;  R0 = eor_mask (Bits)
   ;  R1 = and_mask (Bits)
   ;Exit
   ;  R0 = old_speed (Portable_ProcessorSpeed)
   ;  R1 = new_speed (Portable_ProcessorSpeed)

XPortable_Control               *       &62FC1
Portable_Control                *       &42FC1
   ;Entry
   ;  R0 = eor_mask (Bits)
   ;  R1 = and_mask (Bits)
   ;Exit
   ;  R0 = old_control (Portable_ControlFlags)
   ;  R1 = new_control (Portable_ControlFlags)

XPortable_ReadBMUVariable       *       &62FC2
Portable_ReadBMUVariable        *       &42FC2
   ;Entry
   ;  R0 = var (Portable_BMUVariable)
   ;Exit
   ;  R1 = value (Int)

XPortable_WriteBMUVariable      *       &62FC3
Portable_WriteBMUVariable       *       &42FC3
   ;Entry
   ;  R0 = var (Portable_BMUVariable)
   ;  R1 = value (Int)

XPortable_CommandBMU            *       &62FC4
Portable_CommandBMU             *       &42FC4

XPortable_ReadFeatures          *       &62FC5
Portable_ReadFeatures           *       &42FC5
   ;Exit
   ;  R1 = features (Portable_Features)

XPortable_Idle                  *       &62FC6
Portable_Idle                   *       &42FC6

XPortable_Stop                  *       &62FC7
Portable_Stop                   *       &42FC7
   ;Exit
   ;  R0 = restart (Portable_RestartType)

XPortable_Status                *       &62FC8
Portable_Status                 *       &42FC8
   ;Exit
   ;  R0 = flags (Portable_StatusFlags)

Service_Portable                *       &8A
   ;Entry
   ;  R1 = &8A
   ;  R2 = state (Portable_State)
   ;  R3 = ports (Bits)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R3 = ports_to_change (Bits)

Event_PortableBMU               *       &1C
   ;Entry
   ;  R0 = &1C
   ;  R1 = flags (Portable_BMUFlags)

        ]
        END
